<%@ page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>add students page</title>
<style type="text/css">
td {
	text-align: center;
}

#tb1 {
	border: 1px;
	margin: 0;
	padding: 0;
	border-color: black;
	width: 80%;
	height: auto;
	border-style: solid;
}

#tb2 {
	margin: 0;
	padding: 0;
	width: 100%;
	height: auto;
}

a {
	text-decoration: none;
}
.tr1{
background-color: #cccccc;
}
.tr2{
background-color: #ccccff;
}
</style>
</head>
<body>
<div align="center"
		style="border-style: solid; border-color: black; border-width: 2px; padding: 20px">
		<h1>学生信息</h1>
		<hr>
		<table id="tb1">
			<tr style="background-color: #ccccff">
				<td>序号</td>
				<td>学号</td>
				<td>姓名</td>
				<td>电话</td>
				<td colspan="2">选项</td>
			</tr>
			<c:forEach var="student" items="${sessionScope.Slist}"
				varStatus="num">
				<c:if test="${num.count%2==1}" var="flag">
					<c:set var="temp" value="tr1" scope="page"></c:set>
				</c:if>
				<c:if test="${!flag}">
				<c:set var="temp" value="tr2" scope="page"></c:set>
				</c:if>
				<tr class="${temp}">
						<td>${num.count}</td>
						<td>${student.id}</td>
						<td>${student.name}</td>
						<td>${student.tel}</td>
						<td><a href="student_searchAll?tempid=${student.id}"> <input type="button" value="修改" />
						</a></td>
						<td><a href="student_remove?tempid=${student.id}"><input type="button" value="删除" />
						</a></td>
					</tr>

			</c:forEach>
		</table>

	</div>
	<div align="center">
		<h1>添加学生信息</h1>
		<hr>
		<form action="student_add" method="post">
			<table>
				<tr>
					<td>学号:</td>
					<td><input type="text" name="student.id"></td>
					<td>
					&nbsp;
					</td>
					<td>姓名:</td>
					<td><input type="text" name="student.name"></td>
					<td>
					&nbsp;
					</td>
					<td>电话:</td>
					<td><input type="text" name="student.tel"></td>
					<td>
					&nbsp;
					</td>
					<td colspan="2"><input type="submit" name="add" value="添加">
						<input type="reset" name="clear" value="重置">
					</td>
					<td>
					&nbsp;
					</td>
					<td>
					&nbsp;
					</td>
					<td >
						<a href="index.jsp" style="text-decoration: none;">
							返回&raquo;
						</a>
					</td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>